package com.hyt.it.ogt.pj.service;

import com.baomidou.mybatisplus.extension.service.IService;
import com.hyt.it.ogt.pj.model.entity.Paper;
import com.hyt.it.ogt.pj.model.entity.Subject;
import com.hyt.it.ogt.pj.model.vo.ItemType;
import com.hyt.it.ogt.pj.model.vo.PaperDataVO;

import java.util.List;

/**
 * <p>
 * 试卷表 服务类
 * </p>
 *
 * @author qiaozj
 * @since 2020-07-09
 */
public interface IPaperService extends IService<Paper> {

    /**
     * 初始化时间
     * @param projectId
     * @param admissionNum
     * @throws Exception
     */
    void initPaper(String projectId,String admissionNum) throws Exception;

    Integer initPaperBySubjets(String projectId,String admissionNum, List<Subject> subjects) throws Exception;

    List<Paper> selectByProject(String projectId);

    List<Paper> selectBySubject(String projectId, String subjectId);

    /**
     * 查询试卷是否已存在
     * @param projectId
     * @param subjectId
     * @param paperId
     * @param paperVersion
     * @param packageVersion
     * @return
     */
    Paper existPaper(String projectId, String subjectId, String paperId, Integer paperVersion,Integer packageVersion);

    Paper existPaper(String projectId, String subjectId, String paperId, Integer paperVersion, String packageId, Integer packageVersion);

    /**
     * 查询啥
     * @param paperId
     * @param subjectId
     * @param pieceId
     * @param encodeId
     * @return
     */
    List<ItemType> selectItemTypes(String paperId, String subjectId, String pieceId, String encodeId);

    /***
     * 保存试卷信息
     * @param projectId
     * @param papers
     */
    void savePaper(String projectId, List<PaperDataVO> papers);

    /**
     * 根据项目id和科目id获取试卷信息
     * @param projectId
     * @param subjectId
     * @return
     */
    List<Paper> selectParersBySubjectId(String projectId, String subjectId);
}
